﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>testing jqCamera</title>
    <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="js/icamera/jqCamera.js"></script>
    <script type="text/javascript">
        $(function () {
            jqCamera.init({
                videoName: "video1",
                onInitSuccess: function () {
                    //f_test();
                    jqCamera.setOutPut("display_canvas", 1000 / 20);
                    jqCamera.startOutput();
                    jqCamera.setMotionDetection(0.5);
                    jqCamera.startDetection();
                },
                onDetected: function (data) {
                    console.log("111");
                },
                onOutput:function(data)
                {
                    //console.log(data);
                }
            });
        });

        function f_test() {
            console.log(2);
            document.getElementById("id_img").src = jqCamera.getCurrentImage();
            setTimeout(f_test, 1000);
        }
    </script>
</head>
<body>
    <video id="video1" width="640" autoplay></video>
    <canvas id="display_canvas" width="640" height="480"></canvas>
    <img id="id_img" src="" /> 
</body>
</html>
